<?php
declare(strict_types=1);
/**
 * MineAdmin is committed to providing solutions for quickly building web applications
 * Please view the LICENSE file that was distributed with this source code,
 * For the full copyright and license information.
 * Thank you very much for using MineAdmin.
 *
 * @Author X.Mo<root@imoi.cn>
 * @Link   https://gitee.com/xmo/MineAdmin
 */
namespace Plugin\Attractions\AttractionManagement\Request\Attraction_type;

use Hyperf\Validation\Request\FormRequest;

/**
 * 分类表验证数据类
 */
class AttractionTypeRequest extends FormRequest
{

    public function authorize(): bool
    {
        return true;
    }


    /**
     * 新增数据验证规则
     * return array
     */
    public function rules(): array
    {
        return [
            //类型0:点位，1:信息 验证
            'type' => 'required',
            //分类名称 验证
            'name' => 'required',
            //排序 验证
            'sort' => 'required',
            //父级分类Id 验证
            'parent_id' => 'required',
            //分类层级 验证
            'level' => 'required',

        ];
    }


    /**
     * 字段映射名称
     * return array
     */
    public function attributes(): array
    {
        return [
            'id' => '',
            'type' => '类型0:点位，1:信息',
            'name' => '分类名称',
            'sort' => '排序',
            'parent_id' => '父级分类Id',
            'level' => '分类层级',

        ];
    }

public function messages(): array
{
    return [
            'id.required' => '必填',
            'type.required' => '必填类型0:点位，1:信息',
            'name.required' => '必填分类名称',
            'sort.required' => '必填排序',
            'parent_id.required' => '必填父级分类Id',
            'level.required' => '必填分类层级',

    ];
}
}